import { ref } from 'vue'
import { searchTipsAPI } from './api/search'
import type { SearchTipsResult } from './types/search'

// 搜索-提示语
export const useSearchTips = (keyword: string) => {
  const TipsList = ref<SearchTipsResult[]>([])
  const searchTips = async () => {
    const res = await searchTipsAPI(keyword)
    TipsList.value = res.result
  }
  searchTips()
  return { TipsList }
}
